package com.imooc.log.my;

import java.io.*;
import java.util.HashMap;
import java.util.Map;

public class Test3 {
    public static void main(String[] args) throws Exception {


        InputStream in = Test3.class.getResourceAsStream("/ipRegion.csv");
        InputStreamReader isr = new InputStreamReader(in, "GBK");
        BufferedReader ipRelationReader = new BufferedReader(isr);

        Map<Integer, String> map = new HashMap<Integer, String>();

        String line = "";
        while ((line = ipRelationReader.readLine()) != null) {
            String[] split = line.split(",");
            String provice = split[0];
            Integer ipCode = Integer.valueOf(split[2]);
            map.put(ipCode, provice);
        }


        System.out.println(map);

    }


}
